namespace Vnsf.Data.EF.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class UserAccountUpdate : DbMigration
    {
        public override void Up()
        {
            DropIndex("dbo.Classification", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Classification", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Application", new[] { "Applicant_ID" });
            DropIndex("dbo.Application", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Application", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Application", new[] { "UserAccount_ID" });
            DropIndex("dbo.ApplicationDocument", new[] { "CreatedBy_ID" });
            DropIndex("dbo.ApplicationDocument", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.DocumentShare", new[] { "CreatedBy_ID" });
            DropIndex("dbo.DocumentShare", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Storage", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Storage", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.DocumentFile", new[] { "CreatedBy_ID" });
            DropIndex("dbo.DocumentFile", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.DocumentStorage", new[] { "CreatedBy_ID" });
            DropIndex("dbo.DocumentStorage", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Opportunity", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Opportunity", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Announcement", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Announcement", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Award", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Award", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Report", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Report", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.ReportVersion", new[] { "CreatedBy_ID" });
            DropIndex("dbo.ReportVersion", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Education", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Education", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Expense", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Expense", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.MeasurementUnit", new[] { "CreatedBy_ID" });
            DropIndex("dbo.MeasurementUnit", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Publication", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Publication", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Contract", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Contract", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.ChangeRequest", new[] { "CreatedBy_ID" });
            DropIndex("dbo.ChangeRequest", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.ContractVersion", new[] { "CreatedBy_ID" });
            DropIndex("dbo.ContractVersion", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Grant", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Grant", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Panel", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Panel", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Person", new[] { "Account_ID" });
            DropIndex("dbo.Person", new[] { "LoginAccount_ID" });
            DropIndex("dbo.BankAccount", new[] { "CreatedBy_ID" });
            DropIndex("dbo.BankAccount", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.Job", new[] { "CreatedBy_ID" });
            DropIndex("dbo.Job", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.PanelMemberRole", new[] { "CreatedBy_ID" });
            DropIndex("dbo.PanelMemberRole", new[] { "LastUpdatedBy_ID" });
            DropIndex("dbo.CategoryChild", new[] { "CreatedBy_ID" });
            DropIndex("dbo.CategoryChild", new[] { "LastUpdatedBy_ID" });
            AlterColumn("dbo.UserAccount", "Username", c => c.String());
            AlterColumn("dbo.UserAccount", "Email", c => c.String());
            AlterColumn("dbo.UserAccount", "VerificationKey", c => c.String());
            AlterColumn("dbo.UserAccount", "HashedPassword", c => c.String());
            CreateIndex("dbo.Classification", "CreatedBy_Id");
            CreateIndex("dbo.Classification", "LastUpdatedBy_Id");
            CreateIndex("dbo.Application", "Applicant_Id");
            CreateIndex("dbo.Application", "CreatedBy_Id");
            CreateIndex("dbo.Application", "LastUpdatedBy_Id");
            CreateIndex("dbo.Application", "UserAccount_Id");
            CreateIndex("dbo.ApplicationDocument", "CreatedBy_Id");
            CreateIndex("dbo.ApplicationDocument", "LastUpdatedBy_Id");
            CreateIndex("dbo.DocumentShare", "CreatedBy_Id");
            CreateIndex("dbo.DocumentShare", "LastUpdatedBy_Id");
            CreateIndex("dbo.Storage", "CreatedBy_Id");
            CreateIndex("dbo.Storage", "LastUpdatedBy_Id");
            CreateIndex("dbo.DocumentFile", "CreatedBy_Id");
            CreateIndex("dbo.DocumentFile", "LastUpdatedBy_Id");
            CreateIndex("dbo.DocumentStorage", "CreatedBy_Id");
            CreateIndex("dbo.DocumentStorage", "LastUpdatedBy_Id");
            CreateIndex("dbo.Opportunity", "CreatedBy_Id");
            CreateIndex("dbo.Opportunity", "LastUpdatedBy_Id");
            CreateIndex("dbo.Announcement", "CreatedBy_Id");
            CreateIndex("dbo.Announcement", "LastUpdatedBy_Id");
            CreateIndex("dbo.Award", "CreatedBy_Id");
            CreateIndex("dbo.Award", "LastUpdatedBy_Id");
            CreateIndex("dbo.Report", "CreatedBy_Id");
            CreateIndex("dbo.Report", "LastUpdatedBy_Id");
            CreateIndex("dbo.ReportVersion", "CreatedBy_Id");
            CreateIndex("dbo.ReportVersion", "LastUpdatedBy_Id");
            CreateIndex("dbo.Education", "CreatedBy_Id");
            CreateIndex("dbo.Education", "LastUpdatedBy_Id");
            CreateIndex("dbo.Expense", "CreatedBy_Id");
            CreateIndex("dbo.Expense", "LastUpdatedBy_Id");
            CreateIndex("dbo.MeasurementUnit", "CreatedBy_Id");
            CreateIndex("dbo.MeasurementUnit", "LastUpdatedBy_Id");
            CreateIndex("dbo.Publication", "CreatedBy_Id");
            CreateIndex("dbo.Publication", "LastUpdatedBy_Id");
            CreateIndex("dbo.Contract", "CreatedBy_Id");
            CreateIndex("dbo.Contract", "LastUpdatedBy_Id");
            CreateIndex("dbo.ChangeRequest", "CreatedBy_Id");
            CreateIndex("dbo.ChangeRequest", "LastUpdatedBy_Id");
            CreateIndex("dbo.ContractVersion", "CreatedBy_Id");
            CreateIndex("dbo.ContractVersion", "LastUpdatedBy_Id");
            CreateIndex("dbo.Grant", "CreatedBy_Id");
            CreateIndex("dbo.Grant", "LastUpdatedBy_Id");
            CreateIndex("dbo.Panel", "CreatedBy_Id");
            CreateIndex("dbo.Panel", "LastUpdatedBy_Id");
            CreateIndex("dbo.Person", "Account_Id");
            CreateIndex("dbo.Person", "LoginAccount_Id");
            CreateIndex("dbo.BankAccount", "CreatedBy_Id");
            CreateIndex("dbo.BankAccount", "LastUpdatedBy_Id");
            CreateIndex("dbo.Job", "CreatedBy_Id");
            CreateIndex("dbo.Job", "LastUpdatedBy_Id");
            CreateIndex("dbo.PanelMemberRole", "CreatedBy_Id");
            CreateIndex("dbo.PanelMemberRole", "LastUpdatedBy_Id");
            CreateIndex("dbo.CategoryChild", "CreatedBy_Id");
            CreateIndex("dbo.CategoryChild", "LastUpdatedBy_Id");
            DropColumn("dbo.UserAccount", "RequiresPasswordReset");
            DropColumn("dbo.UserAccount", "MobileCodeSent");
            DropColumn("dbo.UserAccount", "AccountTwoFactorAuthMode");
            DropColumn("dbo.UserAccount", "CurrentTwoFactorAuthStatus");
        }
        
        public override void Down()
        {
            AddColumn("dbo.UserAccount", "CurrentTwoFactorAuthStatus", c => c.Int(nullable: false));
            AddColumn("dbo.UserAccount", "AccountTwoFactorAuthMode", c => c.Int(nullable: false));
            AddColumn("dbo.UserAccount", "MobileCodeSent", c => c.DateTime());
            AddColumn("dbo.UserAccount", "RequiresPasswordReset", c => c.Boolean(nullable: false));
            DropIndex("dbo.CategoryChild", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.CategoryChild", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PanelMemberRole", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.PanelMemberRole", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Job", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Job", new[] { "CreatedBy_Id" });
            DropIndex("dbo.BankAccount", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.BankAccount", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Person", new[] { "LoginAccount_Id" });
            DropIndex("dbo.Person", new[] { "Account_Id" });
            DropIndex("dbo.Panel", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Panel", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Grant", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Grant", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ContractVersion", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.ContractVersion", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ChangeRequest", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.ChangeRequest", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Contract", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Contract", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Publication", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Publication", new[] { "CreatedBy_Id" });
            DropIndex("dbo.MeasurementUnit", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.MeasurementUnit", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Expense", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Expense", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Education", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Education", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ReportVersion", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.ReportVersion", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Report", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Report", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Award", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Award", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Announcement", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Announcement", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Opportunity", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Opportunity", new[] { "CreatedBy_Id" });
            DropIndex("dbo.DocumentStorage", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.DocumentStorage", new[] { "CreatedBy_Id" });
            DropIndex("dbo.DocumentFile", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.DocumentFile", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Storage", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Storage", new[] { "CreatedBy_Id" });
            DropIndex("dbo.DocumentShare", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.DocumentShare", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ApplicationDocument", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.ApplicationDocument", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Application", new[] { "UserAccount_Id" });
            DropIndex("dbo.Application", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Application", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Application", new[] { "Applicant_Id" });
            DropIndex("dbo.Classification", new[] { "LastUpdatedBy_Id" });
            DropIndex("dbo.Classification", new[] { "CreatedBy_Id" });
            AlterColumn("dbo.UserAccount", "HashedPassword", c => c.String(nullable: false, maxLength: 200));
            AlterColumn("dbo.UserAccount", "VerificationKey", c => c.String(maxLength: 100));
            AlterColumn("dbo.UserAccount", "Email", c => c.String(nullable: false, maxLength: 100));
            AlterColumn("dbo.UserAccount", "Username", c => c.String(nullable: false, maxLength: 100));
            CreateIndex("dbo.CategoryChild", "LastUpdatedBy_ID");
            CreateIndex("dbo.CategoryChild", "CreatedBy_ID");
            CreateIndex("dbo.PanelMemberRole", "LastUpdatedBy_ID");
            CreateIndex("dbo.PanelMemberRole", "CreatedBy_ID");
            CreateIndex("dbo.Job", "LastUpdatedBy_ID");
            CreateIndex("dbo.Job", "CreatedBy_ID");
            CreateIndex("dbo.BankAccount", "LastUpdatedBy_ID");
            CreateIndex("dbo.BankAccount", "CreatedBy_ID");
            CreateIndex("dbo.Person", "LoginAccount_ID");
            CreateIndex("dbo.Person", "Account_ID");
            CreateIndex("dbo.Panel", "LastUpdatedBy_ID");
            CreateIndex("dbo.Panel", "CreatedBy_ID");
            CreateIndex("dbo.Grant", "LastUpdatedBy_ID");
            CreateIndex("dbo.Grant", "CreatedBy_ID");
            CreateIndex("dbo.ContractVersion", "LastUpdatedBy_ID");
            CreateIndex("dbo.ContractVersion", "CreatedBy_ID");
            CreateIndex("dbo.ChangeRequest", "LastUpdatedBy_ID");
            CreateIndex("dbo.ChangeRequest", "CreatedBy_ID");
            CreateIndex("dbo.Contract", "LastUpdatedBy_ID");
            CreateIndex("dbo.Contract", "CreatedBy_ID");
            CreateIndex("dbo.Publication", "LastUpdatedBy_ID");
            CreateIndex("dbo.Publication", "CreatedBy_ID");
            CreateIndex("dbo.MeasurementUnit", "LastUpdatedBy_ID");
            CreateIndex("dbo.MeasurementUnit", "CreatedBy_ID");
            CreateIndex("dbo.Expense", "LastUpdatedBy_ID");
            CreateIndex("dbo.Expense", "CreatedBy_ID");
            CreateIndex("dbo.Education", "LastUpdatedBy_ID");
            CreateIndex("dbo.Education", "CreatedBy_ID");
            CreateIndex("dbo.ReportVersion", "LastUpdatedBy_ID");
            CreateIndex("dbo.ReportVersion", "CreatedBy_ID");
            CreateIndex("dbo.Report", "LastUpdatedBy_ID");
            CreateIndex("dbo.Report", "CreatedBy_ID");
            CreateIndex("dbo.Award", "LastUpdatedBy_ID");
            CreateIndex("dbo.Award", "CreatedBy_ID");
            CreateIndex("dbo.Announcement", "LastUpdatedBy_ID");
            CreateIndex("dbo.Announcement", "CreatedBy_ID");
            CreateIndex("dbo.Opportunity", "LastUpdatedBy_ID");
            CreateIndex("dbo.Opportunity", "CreatedBy_ID");
            CreateIndex("dbo.DocumentStorage", "LastUpdatedBy_ID");
            CreateIndex("dbo.DocumentStorage", "CreatedBy_ID");
            CreateIndex("dbo.DocumentFile", "LastUpdatedBy_ID");
            CreateIndex("dbo.DocumentFile", "CreatedBy_ID");
            CreateIndex("dbo.Storage", "LastUpdatedBy_ID");
            CreateIndex("dbo.Storage", "CreatedBy_ID");
            CreateIndex("dbo.DocumentShare", "LastUpdatedBy_ID");
            CreateIndex("dbo.DocumentShare", "CreatedBy_ID");
            CreateIndex("dbo.ApplicationDocument", "LastUpdatedBy_ID");
            CreateIndex("dbo.ApplicationDocument", "CreatedBy_ID");
            CreateIndex("dbo.Application", "UserAccount_ID");
            CreateIndex("dbo.Application", "LastUpdatedBy_ID");
            CreateIndex("dbo.Application", "CreatedBy_ID");
            CreateIndex("dbo.Application", "Applicant_ID");
            CreateIndex("dbo.Classification", "LastUpdatedBy_ID");
            CreateIndex("dbo.Classification", "CreatedBy_ID");
        }
    }
}
